DEFINITION MODULE NewInOut;
(* Definition module for a comfortable character in- and output        *)
(* System : Gardens Point Modula                                       *)
(* Created: 05.06.1994                                                 *)
(* Author : Roland Ortloff                                             *)
(* This file may not be - even not parts of it - changed in any way.   *)
(* Please feel free to distribute it among your friends as long as you *)
(* keep all the files together without any changes.                    *)
(*                                         Copyright by Roland Ortloff *)

(* This program comes without any warranty. Your are using it at your own    *)
(* risk. You may use, copy and distribute this program without restrictions  *)
(* but only in an unmodified way and without charging money for it. Making   *)
(* copies of the source code is forbidden unless copying it for your own use *)
(* and not giving it to another person, neither for money nor for free.      *)
(* It is also strictly forbidden to disassemble any part of this program.    *)


 PROCEDURE ReadZahl(VAR Summe : INTEGER; Links, Rechts, Breite : INTEGER);
 (* Reads an Integer (positive or negative) with a lower (Links) and a      *)
 (* higher (Rechts) limit only allowing digits and one time a '-' only      *)
 (* in the beginning of the input.                                          *)
 (* The width of the input on the screen is limited by the width of the     *)
 (* little window (Breite). So your input scrolls inside the window.        *)
 (* Remember, if you don't wish the scrolling you have to set (Breite)      *)
 (* by at least 1 higher than the longest possible input.                   *)
 (* The extra spot is reserved for the cursor !!!                           *)


 PROCEDURE ReadReell(VAR Zahl : REAL; Links, Rechts : REAL;
                         Max, Breite : INTEGER);
 (* Reads a Real-Number (positive or negative) with a lower (Links) and a   *)
 (* higher (Rechts) limit only allowing digits and one time a '-' only in   *)
 (* the beginning of the input and one time a ','.                          *)
 (* The width of the input on the screen is limited by the width of the     *)
 (* little window (Breite). So your input scrolls inside the window.        *)
 (* Remember, if you don't wish the scrolling you have to set (Breite)      *)
 (* by at least 1 higher than the longest possible input.                   *)
 (* The extra spot is reserved for the cursor !!!                           *)
 (* Your Real-Number will have at most (Max) characters, including the '-'  *)
 (* and the ','. This is helpful if you want to format your output on the   *)
 (* screen like creating matrixes or something else.                        *)

 PROCEDURE WriteReell(Zahl : REAL; Stellen, Bund : INTEGER);
 (* Prints a REAL-number with at most (Stellen) digits after the comma *)
 (* with an orientation to the right of (Bund) digits as a regular     *)
 (* number, e.g. 4.4624e-02 will be printed as 0.04624                 *)


 PROCEDURE ReadKette    (VAR Kette : ARRAY OF CHAR; Erlaubt : ARRAY OF CHAR;
                             Max, Breite : INTEGER);
 (* Reads a String (Kette) only containing characters included in           *)
 (* (Erlaubt) with a maximal number of characters (Max).                    *)
 (* The width of the input on the screen is limited by the width of the     *)
 (* little window (Breite). So your input scrolls inside the window.        *)
 (* Remember, if you don't wish the scrolling you have to set (Breite)      *)
 (* by at least 1 higher than the longest possible input.                   *)
 (* The extra spot is reserved for the cursor !!!                           *)
 (* In case you want to allow basically all of the possible characters,     *)
 (* you may run the command instead of mentioning all the characters in the *)
 (* parameter >Erlaubt< for the allowed keys by running it with 'Alles'.    *)
 (* So basically all of the characters will be allowed.                     *)
 (* Remember that the variable Kette is at least one array bigger than      *)
 (* the actual input will have characters, because an additional NIL-       *)
 (* character will be added to mark the end of the STRING.                  *)


 PROCEDURE ReadKetteVoll(VAR Kette : ARRAY OF CHAR; Erlaubt : ARRAY OF CHAR;
                             Max, Breite : INTEGER);
 (* Same as ReadKette except one addition:                                  *)
 (* However this time it fills the String with blanks until the Length Max. *)


 PROCEDURE Pause;
 (* Waits until keypressed *)


(* If you're interested in the source code of the program e.g. in order  *)
(* to compile it on a different system or to translate it into different *)
(* languages with the help of the documentation, you should send me a    *)
(* small donation of DM 10,- or $ 8,- along with your e-mail address or  *)
(* a correctly prepaid envelope containing a disk to send back to you.   *)
(* !!! You'll never need 'Read' and 'ReadInt' in your life anymore !!!   *)

(* If you have any comments, wishes, bugs or whatever, please feel free  *)
(* to drop me a line. I'll be glad to here something from you, even if   *)
(* you might not like this tool, what I really can't imagine.            *)

(* Just send your e-mail to one of the following e-mail-adresses:       *)
(*     1) ortlofrd@trick.informatik.uni-stuttgart.de                    *)
(* or: 2) zcrk1121@rpool1.rus.uni-stuttgart.de (if anything else fails) *)

(* The newest version is always available at:                           *)
(* ftp.uni-erlangen.de: /pub/pc/msdos/languages/modula                  *)

END NewInOut.
